package com.example.demo.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by lyc on 2019/6/8.
 */
@Component
//@PropertySource({ "classpath:mail.properties", "classpath:db.properties" })
@PropertySource(value = "classpath:hello.properties")
@ConfigurationProperties(prefix = "hello1")//注意指定了虽然 hello.properties 但是application.properties 优先 如果存在
@Data
public class Hello1 {

    private String name;

    private int age;

    // 集合必须初始化，如果找不到就是空集合，会报错
    private List<String> className = new ArrayList<String>();


    private Map map;


}
